package com.yjd.comm.enums;



/**
 * @Description: 远程JOB执行结果状态值
 * @author SongJian 491835898@qq.com
 * @date 2015-5-5
 */
public enum RpcJobExecStatus {

	
	FAILURE(0, "失败"),
	SUCCESS(1, "成功"),
	ERROR1(-1, "定时器的cron改变了"),
	ERROR2(-2, "当前job不可用")
	;
	private RpcJobExecStatus(int value, String description) {
		this.value = value;
		this.description = description;
	}

	private int value;
	private String description;
	/**
	 * @return the value
	 */
	public int getValue()
	{
		return value;
	}

	public String getDescription() {
		return description;
	}

	public static RpcJobExecStatus get(int value) {
		RpcJobExecStatus[] jobStatus = RpcJobExecStatus.values();
		for (RpcJobExecStatus jobEnum : jobStatus) {
			if (jobEnum.getValue()==value) {
				return jobEnum;
			}
		}
		return null;
	}

	public static String getDesc(int value) {
		RpcJobExecStatus[] jobStatus = RpcJobExecStatus.values();
		for (RpcJobExecStatus jobEnum : jobStatus) {
			if (jobEnum.getValue()==value) {
				return jobEnum.getDescription();
			}
		}
		return null;
	}
}
